package com.leetcode.No1893;

/**
 * @program: leetcode
 * @description: 检查是否区域内所有整数都被覆盖
 * @author: wangzhihua
 * @date: 2021-07-24
 */
public class Solution01 {

	public boolean isCovered(int[][] ranges, int left, int right) {
		boolean[] isCovered = new boolean[51];

		for (int[] range : ranges) {
			for (int i = range[0]; i <= range[1]; ++i) {
				isCovered[i] = true;
			}
		}
		for (int i = left; i <= right; i++) {
			if (!isCovered[i]) {
				return false;
			}
		}
		return true;
	}

}
